{%extends '../base/base.tpl'%}

{%block 'title'%}运营管理-订单管理{%/block%}

{%block 'header_css'%}
<link href="../../static/js/common/plugins/chosen/chosen.css?__inline" rel="stylesheet">
<link href="../../static/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
<link href="../../static/css/plugins/cropper/cropper.min.css" rel="stylesheet">  <!--图片上传加裁剪-->


<!-- 上传组件 -->
<link href="../../static/js/common/plugins/fileinput/fileinput.min.css" rel="stylesheet"/>
<!--富文本 -->
<link href="../../static/js/common/plugins/kindeditor/themes/qq/qq.css" rel="stylesheet"/>
<link href="../../static/css/animate.min.css" rel="stylesheet">
<link href="../../static/css/style.min.css?__inline" rel="stylesheet">
<link href="../../static/css/common.css?__inline" rel="stylesheet">


<style type="text/css">
    table{font-size:13px;text-align:center;}
    thead{font-weight:bold;text-align:center;}
    th{text-align: center;}
    .list_edit_table{}
    .is_must{line-height: 34px;}
    table a{display: inline-block;}
    .img-preview-sm{height:78px;}
    .note-editor .note-editable{background: #fff}
    .note-editable{min-height: 200px;}
    .tangram-suggestion-main{z-index: 10000}
    .BMapLabel{margin-top: -20px;max-width: inherit;}
    .btn-danger{    
        background-color: #ec4758;
        border-color: #ec4758;
        color: #FFF;
    }
    .btn-success{
        background-color: #1a7bb9;
        border-color: #1a7bb9;
        color: #FFF;
    }
</style>
{%/block%}

{%block 'header_js'%} 

{%/block%}

{%block 'foot'%}

{%/block%}

{%block 'body'%}
{%assign var=table_operation value="true" %}
{%assign var=table_btn value=array(

    [
        'url'=>'#',
        'text'=>'详情',
        'type'=>'detail_btn',
        'data_target'=>'#table_detail',
        'data_toggle'=>'modal'
    ]
) %}
<div id="wrapper">
    {%include file="../../widget/left_menu.tpl"%}
    <div id="page-wrapper" class="gray-bg dashbard-1">
        {%include file="../../widget/header.tpl"%}
        <div class="row J_mainContent" id="content-main">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h3>订单管理</h3>
                </div>
                <div class="ibox-content">
                    
                    <div class="row">
                        <form method="get" class="form-horizontal">
                            <div class="form-group">
                                <div class="col-sm-4">
                                    <label class="col-sm-3 control-label">起始时间:</label>
                                    <div class="col-md-9">
                                        <input id="order_begin_time" class="form-control layer-date date_input" name="" placeholder="请选择日期" />
                                        <input id="order_begin_time_ed" type="hidden" name="begin_time" placeholder="请选择日期"/>
                                    </div>
                                </div>
                                <div class="col-sm-4">
                                    <label class="col-sm-3 control-label">结束时间:</label>
                                    <div class="col-md-9">
                                        <input id="order_end_time" class="form-control layer-date date_input" name="" placeholder="请选择日期" />
                                        <input id="order_end_time_ed" type="hidden" name="end_time" placeholder="请选择日期"/>
                                    </div>
                                </div>
                                {%if $is_vender_admin %}
                                {%else%}
                                <div class="col-sm-4">
                                    <label class="col-sm-3 control-label">商家名称:</label>
                                    <div class="col-md-9">
                                        <select class="form-control chosen-select" name="vender_id" id="order_vender_id">
                                        </select>
                                    </div>
                                </div>
                                {%/if%}
                            </div>
                            <div class="form-group">
                                
                                <div class="col-sm-4">
                                    <label class="col-sm-3 control-label">客户手机:</label>
                                    <div class="col-md-9">
                                        <input type="text" placeholder="客户手机号" name="mobile" id="order_mobile" class="form-control">
                                    </div>
                                </div>
                                <div class="col-sm-4">
                                    <label class="col-sm-3 control-label">订单编号:</label>
                                    <div class="col-md-9">
                                        <input type="text" placeholder="订单编号" name="order_sn" id="order_order_sn" class="form-control">
                                    </div>
                                </div>
                                <div class="col-sm-4">
                                    <label class="col-sm-3 control-label">价格:</label>
                                    <div class="col-md-9">
                                        <input type="text" placeholder="订单价格" name="goods_price" id="order_goods_price" class="form-control">
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-sm-1">
                                    
                                </div>
                                <div class="col-sm-5">
                                    <div class="radio i-checks col-md-3">
                                        <label class="">
                                            <div class="iradio_square-green"><input type="radio" value="0" class="order_radioed" name="where_radio" id='order_goods_type_ticket' ></div> <i></i> 票类商品</label>
                                    </div>
                                    <div class="radio i-checks col-md-3">
                                        <label class="">
                                            <div class="iradio_square-green"><input type="radio" value="1" class="order_radioed" name="where_radio"  id='order_goods_type_entity' ></div> <i></i> 实体商品</label>
                                    </div>
                                    <div class="radio i-checks col-md-3">
                                        <label class="">
                                            <div class="iradio_square-green"><input type="radio" value="1" class="order_radioed" name="where_radio"  id='order_is_c2c' ></div> <i></i> 乐享单次卡</label>
                                    </div>
                                    <div class="radio i-checks col-md-3">
                                        <label class="">
                                            <div class="iradio_square-green"><input type="radio" value="1" class="order_radioed" name="where_radio"  id='order_share_flag' ></div> <i></i> 乐享多次卡</label>
                                    </div>

                                <input type="hidden" id="hid_goods_type"  name = "goods_type"  >
                                <input type="hidden" id="hid_is_c2c"  name = "is_c2c"  >
                                <input type="hidden" id="hid_share_flag"  name = "share_flag"  >



                                </div>
                                <div class="col-sm-4 pull-right">
                                    <label class="col-sm-3 control-label"></label>
                                    <div class="col-md-9" id="regionWrap">
                                        <button class="btn btn-primary pull-right"  type="submit"><i class="fa fa-search"></i>&nbsp;搜索</button>
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>
                    <div class="hr-line-dashed"></div>
                    
                    
                    {%include file="../../widget/table_mod.tpl"%}
                    {%include file="../../widget/pagination.tpl"%}
                </div>
            </div>
        </div>
        {%include file="../../widget/footer.tpl"%}
    </div>
</div>
{%include file="../../widget/editable_mod.tpl"%}
{%/block%}
  
{%block 'foot_js'%}
<script src="../../static/js/common/plugins/chosen/chosen.jquery.js?__inline"></script>
<script src="../../static/js/common/content.min.js"></script>
<script src="../../static/js/common/plugins/validate/jquery.validate.min.js"></script>
<script src="../../static/js/common/plugins/validate/messages_zh.min.js"></script>
<script src="../../static/js/common/jquery.form.js"></script>
<script src="../../static/js/common/plugins/layer/laydate/laydate.js"></script> 
<script src="../../static/js/common/plugins/sweetalert/sweetalert.min.js"></script>
<script src="../../static/js/common/plugins/jeditable/jquery.jeditable.js"></script> 
<script src="../../static/js/common/plugins/dataTables/jquery.dataTables.js"></script> 
<script src="../../static/js/common/plugins/dataTables/dataTables.bootstrap.js"></script> 
<script src="../../static/js/common/plugins/iCheck/icheck.min.js"></script> 
<script src="../../static/js/common/plugins/cropper/cropper.min.js"></script> 
<script src="../../static/js/common/plugins/ajaxfileupload/ajaxfileupload.js"></script> 

<!-- 上传组件 -->
<script src="../../static/js/common/plugins/fileinput/fileinput.min.js"></script>
<script src="../../static/js/common/plugins/fileinput/fileinput_locale_zh.js"></script>
<!-- 富文本 -->
<script type="text/javascript" charset="utf-8" src="../../static/js/common/plugins/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="../../static/js/common/plugins/ueditor/ueditor.all.min.js"> </script>
<script type="text/javascript" charset="utf-8" src="../../static/js/common/plugins/ueditor/lang/zh-cn/zh-cn.js"></script>
<!-- <script src="../../static/js/table/tableoperation.js"></script> -->
<script src="../../static/js/searchfordate/script.js?__inline"></script> <!--搜索条件的时间调用函数-->
<script src="../../static/js/table/tableModel.js"></script>
<script type="text/javascript">
$(document).ready(function(){$(".i-checks").iCheck({checkboxClass:"icheckbox_square-green",radioClass:"iradio_square-green",})});



    var customFun = {
        
        
      
      };
common_option = customFun;
var WinUrl = window.location.search;
function getUrlParam(name){   //获取URL参数值
    //构造一个含有目标参数的正则表达式对象  
    var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");  
    //匹配目标参数  
    var r = decodeURI(window.location.search.substr(1)).match(reg);  
    //返回参数值  
    if (r!=null) return unescape(r[2]);  
    return null;  
}
$(function(){
    venderAjax();
    if(WinUrl.indexOf("is_c2c") > 0 && getUrlParam('is_c2c') == "1"){
        $("#order_is_c2c").attr("checked","checked");
        $("#hid_is_c2c").val('1');
        $(".i-checks").iCheck({checkboxClass:"icheckbox_square-green",radioClass:"iradio_square-green",})
    }
    if(WinUrl.indexOf("share_flag") > 0 && getUrlParam('share_flag') == "1"){
        $("#order_share_flag").attr("checked","checked");
        $("#hid_share_flag").val('1');
        $(".i-checks").iCheck({checkboxClass:"icheckbox_square-green",radioClass:"iradio_square-green",})
    }
    if(WinUrl.indexOf("order_sn") > 0){
        $("#order_order_sn").val(getUrlParam('order_sn'))
    }
    if(WinUrl.indexOf("goods_price") > 0){
        $("#order_goods_price").val(getUrlParam('goods_price'))
    }
    
    if(WinUrl.indexOf("mobile") > 0){
        $("#order_mobile").val(getUrlParam('mobile'))
    }
    if(WinUrl.indexOf("goods_type") > 0){
        if(getUrlParam('goods_type') == "0"){
            $("#order_goods_type_ticket").attr("checked","checked");
            $("#hid_goods_type").val('0');
            $(".i-checks").iCheck({checkboxClass:"icheckbox_square-green",radioClass:"iradio_square-green",})
        }else if(getUrlParam('goods_type') == "1"){
            $("#order_goods_type_entity").attr("checked","checked");
            $("#hid_goods_type").val('1');
            $(".i-checks").iCheck({checkboxClass:"icheckbox_square-green",radioClass:"iradio_square-green",})
        }
        
    }

    if(WinUrl.indexOf("begin_time") > 0){
        $("#order_begin_time").val(date_new_h(getUrlParam('begin_time')));
        $("#order_begin_time_ed").val(getUrlParam('begin_time'));
    }
    if(WinUrl.indexOf("end_time") > 0){
        $("#order_end_time").val(date_new_h(getUrlParam('end_time')));
        $("#order_end_time_ed").val(getUrlParam('end_time'));
    }
    $('.order_radioed').on('ifChecked', function(event){ //ifCreated 事件应该在插件初始化之前绑定 
        var hid = $(this).attr('id')  ;
        if(hid == "order_goods_type_ticket"){
            $("#hid_goods_type").val('0');
            $("#hid_is_c2c").val(null);
            $("#hid_share_flag").val(null);
        }else if(hid=="order_goods_type_entity"){
            $("#hid_goods_type").val('1');
            $("#hid_is_c2c").val(null);
            $("#hid_share_flag").val(null);
        }else if(hid=="order_is_c2c"){
            $("#hid_goods_type").val(null);
            $("#hid_is_c2c").val('1');
            $("#hid_share_flag").val(null);
        }else if(hid=="order_share_flag"){
            $("#hid_goods_type").val(null);
            $("#hid_is_c2c").val(null);
            $("#hid_share_flag").val('1');
        }
    }); 
    
    function is_share_goods(){
        if($("#goods_goods_type").val() == 1){
            $("#goods_is_share_card").val("0").attr("disabled","disabled");
        }else{
            $("#goods_is_share_card").removeAttr("disabled");
        }
    }
    function venderAjax(){
        $.ajax({
            url:"/ajax/call/basedata/vender_list",
            type:'post',
            success:function(res){
                if(res.data_list!=undefined){
                    var dlist = res.data_list;
                    var html = '<option value="">未选择</option>';
                    for(var i = 0;i < dlist.length; i++ ){
                        if(WinUrl.indexOf("vender_id") > 0 && getUrlParam('vender_id') != null && getUrlParam('vender_id') != ""){
                            if(getUrlParam('vender_id') == dlist[i].id ){
                                html +='<option value="'+dlist[i].id+'" selected>'+dlist[i].name+'</option>'
                            }else{
                                html +='<option value="'+dlist[i].id+'" >'+dlist[i].name+'</option>'
                            }
                        }else{
                            html +='<option value="'+dlist[i].id+'" >'+dlist[i].name+'</option>'
                        }
                    }
                    $("#order_vender_id").html("").append(html);
                    $('#order_vender_id').chosen({});
                }

            }  

        });
    }
});
  

  
  
  

 

</script> 
{%/block%}

